Ext.define('appmod.view.knowledge.category.fileformat.DefaultListView', {
    extend: 'Ext.grid.Panel',
    alias: [
		'widget.knowledge.category.fileformat.list',
		'widget.knowledge-category-fileformat-list'
	],
    margins:"5 5 0 5",
    region : 'center',
    title: '文件格式',
	requires:[
		'Ext.ux.form.SearchField'
	],	

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
            columns: [
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'name',
					minWidth:130,
                    text: '分类名称'
                },
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'supportSurfix',
					flex: 1,
					text: '适用格式文件名'
                }
            ],
            viewConfig: {

            },
            selModel: Ext.create('Ext.selection.CheckboxModel', {
                allowDeselect: true
            }),            
            dockedItems: [
                {
                    xtype: 'pagingtoolbar',
                    width: 360,
					store:me.store,
                    displayInfo: true,
                    dock: 'bottom'
                },
                {
                    xtype: 'toolbar',
                    dock: 'top',
                    items: [
                        {
                            xtype: 'splitbutton',
                            text: '文件分类格式',
                            menu: {
                                xtype: 'menu',
                                width: 120,
                                items: [
                                    {
                                        xtype: 'menuitem',
                                        text: '新增文件格式',
										action : 'addFileFormat'
                                    },
                                    {
                                        xtype: 'menuitem',
                                        text: '更新文件格式',
										action : 'updateFileFormat'
                                    },
                                    {
                                        xtype: 'menuitem',
                                        text: '删除文件格式',
										action : 'deletesFileFormat'
                                    }								
                                ]
                            }
                        },'-',
						{
					        width: 400,
					        fieldLabel: '文件分类查询',
					        labelWidth: 80,
					        xtype: 'searchfield'
					        //store: me.store
				        }						
                    ]
                }
            ],
			listeners:{
				
			}
        });

        me.callParent(arguments);
    },
	
	bindStore:function(store) {
		var me = this;
		
		var pagingbar = me.down('pagingtoolbar');
		pagingbar.bindStore(store);
		
		var searchField = me.down('searchfield');
		searchField.bindStore(store);
		me.callParent(arguments);		
	}
});